From 4d7c89ebd8c6e4ab4c7b1ffe869998acd4c2a984 Mon Sep 17 00:00:00 2001 From: Krinkle Date: Tue, 3 Jan 2012 22:16:24 +0000 Subject: [PATCH] [JSTesting] Fix static html tests * static tests need wgServer as well * Follows-up r107946, r107919 --- tests/qunit/index.html | 1 + .../suites/resources/mediawiki/mediawiki.test.js | 12 +----------- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/tests/qunit/index.html b/tests/qunit/index.html index 94428812e7..9845cfbba1 100644 --- a/tests/qunit/index.html +++ b/tests/qunit/index.html @@ -38,6 +38,7 @@ var scriptPath = pathParts.join( '/' ); mw.config.set({ + "wgServer": location.protocol + '//' + location.host, "wgScriptPath": scriptPath, "wgLoadScript": scriptPath + '/load.php', "stylepath": scriptPath + '/skins', diff --git a/tests/qunit/suites/resources/mediawiki/mediawiki.test.js b/tests/qunit/suites/resources/mediawiki/mediawiki.test.js index 92141315df..13f19852b6 100644 --- a/tests/qunit/suites/resources/mediawiki/mediawiki.test.js +++ b/tests/qunit/suites/resources/mediawiki/mediawiki.test.js @@ -175,19 +175,9 @@ test( 'mw.loader.bug30825', function() { expect(2); - var server = mw.config.get( 'wgServer' ), - basePath = mw.config.get( 'wgScriptPath' ); - - // From [[Special:JavaScriptTest]] we need to preprend the script path - // with the actual server (http://localhost/). - // Running from file tests/qunit/index.html, wgScriptPath is already - // including the wgServer part - if( server !== null ) { - basePath = server + basePath; - } // Forge an URL to the test callback script var target = QUnit.fixurl( - basePath + '/tests/qunit/data/qunitOkCall.js' + mw.config.get( 'wgServer' ) + mw.config.get( 'wgScriptPath' ) + '/tests/qunit/data/qunitOkCall.js' ); // Confirm that mw.loader.load() works with protocol-relative URLs -- 2.20.1